Field of the Invention
The present invention relates to an image processing apparatus and an image processing method, and particularly relates to a pixel value correction technique.
Description of the Related Art
Conventionally, an image sensor, in which a portion of pixels are configured as focusing pixels, that uses output of the focusing pixels to enable focus detection according to a phase-difference detection method is known (Japanese Patent Laid-Open No. 2000-156823).
However, because a focusing pixel has a structure different to that of a normal pixel (an imaging pixel), there are cases in which there is an influence on the pixel values surrounding the focusing pixel, and image degradation is caused to occur. Japanese Patent Laid-Open No. 2009-124573 proposes a method that uses a crosstalk rate according to an aperture value to correct values of imaging pixels surrounding a focusing pixel based on a value of a focusing pixel in the vicinity of the imaging pixels. In addition, Japanese Patent Laid-Open No. 2013-247597 proposes a method that determines whether a flare due to reflected light from a wiring region has occurred in accordance with existence/absence of a magenta region greater than or equal to a predetermined numbers of pixels, and applies smoothing processing when an imaging pixel surrounding a focusing pixel belongs to the magenta region. It also determines that the influence of a flare is more strongly received, and increases the smoothness, the more a pixel belongs to a region for which the magenta color is deep.
Because spectral characteristics of light incident on a focusing pixel differs to that for an imaging pixel, there are two causes for an influence on a value of an imaging pixel adjacent to a focusing pixel—crosstalk and flare (ghost)—and it is possible for both influences to be mixed inside one image. Because it is more likely for flare to occur if a bright light source is present, it can have a larger influence on the pixel value than crosstalk.
If processing that corrects the influence of flare is applied to pixels that are not influenced by the flare, a false correction becomes the cause of an image degradation, and therefore it is necessary to detect with good precision pixels that are influenced by flare. However, in the technique recited in Japanese Patent Laid-Open No. 2013-247597, because a magenta color region is detected as a collection of pixels that are influenced by a flare, there is the possibility that a region of a magenta-colored object will be incorrectly detected as a region that became the magenta color due to flare.